<template>
  <div>
    <van-cell is-link>
      <template #title>
        <span>{{ record.name }}</span>
        <span> -- </span>
        <span>{{ record.partner_id[1] }}</span>
      </template>

      <template #label>
        <van-tag :type="state2obj.type">{{ state2obj.text }}</van-tag>
        <span> {{ record.create_date }} </span>
      </template>

      <template>
        <span>{{ `¥${record.amount_total}` }}</span>
      </template>
    </van-cell>

    <!-- partner_id -->
  </div>
</template>

<script>
export default {
  name: 'action_quotations_with_onboarding',
  components: {},
  mixins: [],

  props: {
    viewInfo: {
      type: Object,
      default: () => {
        return {}
      }
    },

    dataInfo: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },

  data() {
    return {}
  },

  computed: {
    record() {
      return this.dataInfo.record || {}
    },

    state2obj() {
      const states = {
        draft: { type: 'primary', color: '#7232dd', text: '草稿' },
        sent: { type: 'success', color: '#7232dd', text: '已发送' },
        cancel: { type: 'danger', color: '#7232dd', text: '已取消' },
        sale: { type: 'warning', color: '#7232dd', text: '销售订单' },
        done: { type: 'danger', color: '#7232dd', text: '锁定' }
      }

      return (
        states[this.record.state] || {
          type: undefined,
          text: this.record.state
        }
      )
    }
  },

  created() {
    // console.log(this.record)
  },

  methods: {}
}
</script>

<style scoped></style>
